package xcmg.device.dao.mapper.warehouse;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import xcmg.device.dao.entity.warehouse.AbnormalInDO;
import xcmg.device.dao.entity.warehouse.export.AbnormalInExportDO;
import xcmg.device.service.vo.warehouse.AbnormalInVO;

import java.util.List;

@Mapper
public interface AbnormalInMapper {
    int deleteByPrimaryKey(String id);

    int insert(AbnormalInDO record);

    AbnormalInDO selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(AbnormalInDO record);
    //编辑时的更新，专门使用，涉及到审核相关信息如果传null则置空，而不是传null时不处理
    int update4Edit(AbnormalInDO record);

    int updateByPrimaryKey(AbnormalInDO record);

    List<AbnormalInDO> list(AbnormalInVO vo);

    List<String> findOrderList(@Param("ids") List<String> ids);

    int remove(@Param("ids") List<String> ids);

    List<AbnormalInDO> findByIds(@Param("ids") List<String> ids);

    AbnormalInDO selectByAbnormalNo(@Param("abnormalNo") String abnormalNo, @Param("orgId") String orgId);

    List<AbnormalInExportDO> findListForExport(@Param("ids") List<String> ids);

    int findCountForExportAll(AbnormalInVO model);

    List<AbnormalInExportDO> findListForExportAll(AbnormalInVO model);

    List<AbnormalInDO> findForDeleteByIds(@Param("ids") List<String> ids);

    int updateStateNoBarcode(@Param("status") Integer status, @Param("businessOrder") String businessOrder, @Param("orgId") String orgId);

    List<AbnormalInDO> list4SapPosting(@Param("orgId")String orgId);

    List<AbnormalInDO> selectAuditByIds(@Param("ids") List<String> ids);

    int updateAuditStatus(@Param("ids") List<String> ids, @Param("auditStatus") Integer auditStatus, @Param("auditRemark") String auditRemark,
                          @Param("userId") String userId, @Param("userName") String userName);

    Integer countAuditData(@Param("orgId") String orgId);
}
